import { getCreateList } from '@/api/common';

import { PROMOTION_ACTIVITY_SELECT_TYPE } from '@/const/ecommerce';

// 按员工：搜索项配置
export const employeeColunms = [
    {
        label: '员工账号',
        name: 'account_ids',
        type: 'select',
        placeholder: '请选择子账号',
        clearable: true,
        multiple: true,
        fetchOptionApi: () => {
            return new Promise(resolve => {
                getCreateList({ noNeedLoading: true }).then(res => {
                    const arr = res.map((item: any) => {
                        item.value = item.id;
                        item.label = `${item.name}  (${item.phone}) `;
                        return item;
                    });
                    resolve(arr);
                });
            });
        }
    },
    {
        label: '推广类型',
        type: 'select',
        name: 'promotion_type',
        value: [],
        clearable: true,
        multiple: true,
        placeholder: '请选择推广类型',
        optionList: [...PROMOTION_ACTIVITY_SELECT_TYPE]
    }
];

// 按商品：搜索项配置
export const productColunms = [
    {
        label: '员工账号',
        name: 'account_ids',
        type: 'select',
        placeholder: '请选择子账号',
        clearable: true,
        multiple: true,
        fetchOptionApi: () => {
            return new Promise(resolve => {
                getCreateList({ noNeedLoading: true }).then(res => {
                    const arr = res.map((item: any) => {
                        item.value = item.id;
                        item.label = `${item.name}  (${item.phone}) `;
                        return item;
                    });
                    resolve(arr);
                });
            });
        }
    }
];

// 按推广链接：搜索项配置
export const promotionLinkColunms = [];
